package changestream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by 5406160@qq.com on LiBoWen 李博闻.
 *
 * @ClassName : InputStreamReaderDemo
 * @Author : 54061
 * @Date: 2022/2/14 14:57
 */
/*
 InputStreamReader(InputStream in, String charsetName): 按照指定的编码格式读文件

 */
public class InputStreamReaderDemo {
    public static void main(String[] args) throws IOException {
        //创建流对象
        InputStreamReader isr = new InputStreamReader(new FileInputStream(""));

        char[] chs = new char[1024];
        int len;
        while ((len = isr.read(chs)) !=-1){
            //输出内容
            String line = new String(chs,0,len);
            System.out.println(line);
        }
        //关流
        isr.close();
    }
}
